﻿@using CodeCamp.Infrastructure.Extensions
@using CodeCamp.Model
@using CodeCamp.Models.Shared
@model CodeCamp.Models.Sessions.SessionsEditViewModel

<script src="@Url.Content("~/Scripts/jquery-1.5.1.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
@*<script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>*@

@using (Html.BeginForm()) {
    @Html.ValidationSummary(true)
    <fieldset>
        <legend>@ViewBag.SessionEditLegend</legend>

        @Html.HiddenFor(model => model.SessionId)
        @Html.HiddenFor(model => model.PresenterId)
        @Html.HiddenFor(model => model.HideNotes)

        @if (User.IsInRole(CCRoles.RoleNames.BigCheeze) || User.IsInRole(CCRoles.RoleNames.EventContentEditor))
        {
        <div class="editor-label">
            @Html.LabelFor(model => model.StatusID, "Status")
        </div>
        <div class="editor-field">
            @Html.DropDownListFor(model => model.StatusID, Model.StatusSelectList)
            @Html.ValidationMessageFor(model => model.StatusID)
        </div>
        }
        //else if (User.IsInRole(CCRoles.RoleNames.EventTrackLead))
        //{
        //}
        else
        {
            @Html.HiddenFor(model => model.StatusID)
        }
        <div class="editor-label">
            @Html.LabelFor(model => model.Title, "Session Title")
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.Title)
            @Html.ValidationMessageFor(model => model.Title)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.DesiredRoomSize, "Desired Room Size (e.g. small, medium, large -- no guarantees...)")
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.DesiredRoomSize)
            @Html.ValidationMessageFor(model => model.DesiredRoomSize)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.Description, "Session Description")
        </div>
        <div class="editor-field">
            @Html.TextAreaFor(model => model.Description, new { cols = 80, rows = 10 })
            @Html.ValidationMessageFor(model => model.Description)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.SessionMaterialsUrl, "Materials View/Download Url, start with http:// (optional, can be added later)")
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.SessionMaterialsUrl)
            @Html.ValidationMessageFor(model => model.SessionMaterialsUrl)
            <p class="field-note">URL can be link to follow-up blog post, or link to downloadable file.<br />
            Will not be visible to the public until the day of the event.</p>
        </div>

        @if (!Model.HideNotes)
        {
        <div class="editor-label">
            @Html.LabelFor(model => model.PrivateNotes, "Private Notes for Presenter and Organizers")
        </div>
        <div class="editor-field">
            @Html.TextAreaFor(model => model.PrivateNotes, new { cols = 80, rows = 10 })
            @Html.ValidationMessageFor(model => model.PrivateNotes)
        </div>
        }

        @if (User.IsInRole(CCRoles.RoleNames.BigCheeze) || User.IsInRole(CCRoles.RoleNames.EventContentEditor))
        {
        <div class="editor-label">
            @Html.LabelFor(model => model.OrganizerNotes, "Private Notes for Organizers only")
        </div>
        <div class="editor-field">
            @Html.TextAreaFor(model => model.OrganizerNotes, new { cols = 80, rows = 10 })
            @Html.ValidationMessageFor(model => model.OrganizerNotes)
        </div>
        }

        <p>
            <input type="submit" value="Save" />
        </p>
    </fieldset>
}
